{% extends "base.html" %}
{% block title %}Photo: {{ photo.title }}{% endblock %}
{% block css %}photos.css{% endblock %}
{% block extra_head %}
	<link rel="Start" href="{{ photo.gallery.get_absolute_url }}" />
	{% if prev_photo %}
		<link rel="Prev"  href="{{ prev_photo.get_absolute_url }}" />
	{% endif %}
	{% if next_photo %}
		<link rel="Next"  href="{{ next_photo.get_absolute_url }}" />
	{% endif %}
{% endblock %}
{% block content %}
	<div class="navigation">
		{% if prev_photo %}
			<a href="{{ prev_photo.get_absolute_url }}">&lsaquo;&nbsp;</a>
		{% endif %}
		<a href="{{ photo.gallery.get_absolute_url }}">&uarr;</a>
		{% if next_photo %}
			<a href="{{ next_photo.get_absolute_url }}">&nbsp;&rsaquo;</a>
		{% endif %}
	</div>
	<div class="image">
		<img src="{{ MEDIA_URL }}{{ photo.detail_image }}" alt="{{ photo.title }}" />
	</div>
	<table class="metadata"><tbody>
		<tr>
			<td class="left">Title:</td>
			<td class="right">{{ photo.title }}</td>
		</tr>
		{% for contribution in photo.contributions.all %}
			<tr>
				<td class="left">{{ contribution.role }}:</td>
				<td class="right">
					<a href="{% url artist-detail contribution.artist.slug %}">
						{{ contribution.artist.name }}
					</a>
				</td>
			</tr>
		{% endfor %}
		{% if photo.license %}
			<tr>
				<td class="left">License:</td>
				<td class="right"><a href="{{ photo.license.get_absolute_url }}">{{ photo.license.title }}</a></td>
			</tr>
		{% endif %}
		{% if photo.location %}
			<tr>
				<td class="left">Location:</td>
				<td class="right"><a href="{{ photo.location.get_absolute_url }}">{{ photo.location.title }}</a></td>
			</tr>
		{% endif %}
		<tr>
			<td class="left">Published:</td>
			<td class="right">{{ photo.published|date:"Y-m-d" }}</td>
		</tr>
		<tr>
			<td class="left">Gallery:</td>
			<td class="right">
				<a href="{{ photo.gallery.get_absolute_url }}">	{{ photo.gallery.title }}</a>
			</td>
		</tr>
	
		{% if photo.description %}
			<tr>
				<td class="left">Description:</td>
				<td class="right">{{ photo.description }}</td>
			</tr>
		{% endif %}
		<tr>
			<td class="left">Tags:</td>
			<td class="right">
				{% if photo.tags.all|length_is:"0" %}
					none
				{% else %}
					{% for tag in photo.tags.all %}
						<a href="{{ tag.get_absolute_url }}">
							{{ tag.title }}
						</a>&nbsp;
					{% endfor %}
				{% endif %}
			</td>
		</tr>
	</tbody></table>
{% endblock %}